Computer based pain management